/*
package NiuKe;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

*/
/**
 * @Description:
 * @Author: Hanzao
 * @Date: 2022/06/20/23:33
 *//*

public class HJ86 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        List<Integer> list = new ArrayList<>();
        while (num!=0){
            list.add(num%2);
            num/=2;
        }
        int size = list.size();
        int[] arr = new int[size+1];

        if(list.get(0) == 0){
            arr[0] = 0;
        }else{
            arr[0] = 1;
        }
        for(int i=1;i<size;i++){
            if(list.get(i)==1){
                arr[i] = arr[i-1]+1;
            }else{
                arr[i] = 0;
            }
        }

        int max = 0;
        for(int i=0;i<size;i++){
            if(arr[i] > max){
                max = arr[i];
            }
        }
        System.out.println(max);

    }

}
*/
